package com.example.demo810.biz;

import com.example.demo810.po.SysUserRole;
import com.example.demo810.repo.UserRoleRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author lzh
 * @date 2020/8/10 - 10:49
 */
@Service
public class SysUserRoleService {

    @Autowired
    UserRoleRepo userRoleRepo;

    public List<SysUserRole> listByUserId(Long userId){
        return userRoleRepo.findAll(Example.of(SysUserRole.builder()
                .userId(userId)
                .build()));
    }
}
